import request from '@/utils/request';

export interface LoginParams {
  username: string;
  password: string;
}

export interface UserInfo {
  id: number;
  username: string;
  name: string;
  role: string;
}

export interface LoginResult {
  token: string;
  user: UserInfo;
}

export const login = (params: LoginParams) => {
  return request.post<LoginResult>('/auth/login', params);
}; 